import request from '@/utils/request'

export function getRoles() {
  return request({
    url: 'api/roles',
    method: 'get'
  })
}

export function addRoles(data) {
  return request({
    url: '/api/roles',
    method: 'post',
    data
  })
}

export function updateRoles(id,data) {
  return request({
    url: '/api/roles/'+ id,
    method: 'put',
    data
  })
}

export function deleteRoles(id) {
  return request({
    url: '/api/roles/'+ id,
    method: 'delete',
  })
}

export function saveRolePermission(data) {
    return request({
      url: '/api/roles/saveRolePermission',
      method: 'post',
      data
    })
  }

  